home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / Example / IC Call Glue ƒ / IC Call Glue.c
Encoding:
C/C++ Source or Header  |  1995-11-18  |  26.2 KB  |  1,323 lines  |  [TEXT/SPM ]

  1. /*
  2.     IC Call Glue.c
  3.     
  4.     Code to call the IC component.
  5.     
  6.     The glue comes in two forms, PPC only and PPC/68k glue.
  7.     
  8.     The PPC/68k glue provides the ICStart and ICStop routines for starting
  9.     and stopping the IC Component.
  10.     
  11.     The PPC glue provides the PPC code for the component interface (see note below).
  12.     
  13.     Important Note:
  14.         
  15.         This information (probably ;-) was derived by examining the tech note
  16.         "QT 05 - Component Manager version 3.0" which describes in detail how
  17.         to call a component from PPC code.  Before modifying any of this code,
  18.         you should take a look at that tech note.
  19.     
  20.     The author of this code was not mentioned before I (dhn) modified it.  Whoever
  21.     it is deserves most of the credit.
  22. */
  23.  
  24. #include <Types.h>
  25. #include <MixedMode.h>
  26. #include <Components.h>
  27.  
  28. #include "IC Types.h"
  29. #include "IC Component API.h"
  30.  
  31. /*
  32.     ICCStart
  33.     
  34.     Routine to initialize the IC component.  Will ensure the component manager
  35.     is available, open a default instance of the IC component, and start it up.
  36. */
  37. pascal ICError ICCStart(internetConfigurationComponent *inst, OSType creator){
  38.     ICError err,junk;
  39.     long response;
  40.     
  41.     *inst=(internetConfigurationComponent)0;
  42.     
  43.     if (Gestalt(gestaltComponentMgr,&response)==noErr){
  44.         *inst=(internetConfigurationComponent)OpenDefaultComponent(internetConfigurationComponentType,internetConfigurationComponentSubType);
  45.     }
  46.     
  47.     if (*inst==(internetConfigurationComponent)0){
  48.         return badComponentInstance;
  49.     } else {
  50.         err=ICCStartComponent(*inst,creator);
  51.         
  52.         if (err!=noErr){
  53.             junk=CloseComponent((ComponentInstance)*inst);
  54.             *inst=(internetConfigurationComponent)0;
  55.         }
  56.     }
  57.     
  58.     return err;
  59. }
  60.  
  61. /*
  62.     ICCStop
  63.     
  64.     Shuts down the IC component then closes it completely.
  65. */
  66. pascal ICError ICCStop(internetConfigurationComponent inst){
  67.     ICError err,err2;
  68.     
  69.     err=ICCStopComponent(inst);
  70.     err2=CloseComponent((ComponentInstance)inst);
  71.     
  72.     if (err==noErr)
  73.         err=err2;
  74.     
  75.     return err;
  76. }
  77.  
  78. /*
  79.     Only include the following code if we are compiling for the PPC!
  80. */
  81. #if defined(powerc) || defined (__powerc)
  82.  
  83. enum {
  84.     uppCallComponentProcInfo = kPascalStackBased
  85.         | RESULT_SIZE(kFourByteCode)
  86.         | STACK_ROUTINE_PARAMETER(1, kFourByteCode)
  87. };
  88.  
  89. /*
  90.     For an explanation of the inner workings of the following macros,
  91.     see the ICCFindConfigFile() function.
  92. */
  93.  
  94. /* A few macros to simplify the code (or does it make it more complex?  ;-) */
  95. #define CallComponentGlue(ptr) \
  96.     CallUniversalProc(CallComponentUPP,uppCallComponentProcInfo,(ptr))
  97.  
  98. #define PPC_Glue(parmsType) \
  99.     unsigned char flags; \
  100.     unsigned char size; \
  101.     short what; \
  102.     parmsType parms; \
  103.     internetConfigurationComponent inst
  104.  
  105. #define SetupGlue(var,sel,type,ic)\
  106.     (var).flags=0;\
  107.     (var).size=sizeof(type);\
  108.     (var).what=(sel);\
  109.     (var).inst=(ic)
  110.  
  111. #define PPC_VoidGlue \
  112.     unsigned char flags; \
  113.     unsigned char size; \
  114.     short what; \
  115.     internetConfigurationComponent inst
  116.  
  117. #define SetupVoidGlue(var,sel,ic)\
  118.     (var).flags=0;\
  119.     (var).size=0;\
  120.     (var).what=(sel);\
  121.     (var).inst=(ic)
  122.  
  123. #define SetGlueParm(var,ps,val) \
  124.     (var).parms.ps=(val)
  125.  
  126. /*
  127.     NOTE:
  128.     
  129.         For the PPC glue to work, the structures must be padded for 68k stacks.
  130.         
  131.         This means that everything must be padded on a word boundary.
  132.         
  133.         For types that are of odd number of bytes (i.e. char), you must add a
  134.         filler character after the type to pad it to a word.
  135.         
  136.         The list of types that need padding from the IC Types.h file are:
  137.         
  138.             (Booleans, chars, unsigned chars, ...)
  139.             ICPerm
  140. */
  141.  
  142. /*
  143.     ICCStartComponent
  144.     
  145.     PPC glue to call the component with the correct selector.
  146. */
  147. pascal ICError ICCStartComponent(internetConfigurationComponent inst, OSType creator){
  148.     ICError junk;
  149.     ICError err;
  150.  
  151. #pragma options align=mac68k
  152.     struct GlueParms {
  153.         OSType creator;
  154.     };
  155.     
  156.     typedef struct GlueParms GlueParms;
  157.     
  158.     struct ICCallGlue {
  159.         PPC_Glue(GlueParms);
  160.     };
  161.     
  162.     typedef struct ICCallGlue ICCallGlue;
  163. #pragma options align=reset
  164.     
  165.     ICCallGlue glue;
  166.     
  167.     if (inst==(internetConfigurationComponent)0) {
  168.         err = badComponentInstance;
  169.     } else {
  170.         SetupGlue(glue,kICCStart,GlueParms,inst);
  171.         
  172.         SetGlueParm(glue,creator,creator);
  173.         
  174.         err = CallComponentGlue(&glue);
  175.     }
  176.     
  177.     return err;
  178. }
  179.  
  180. /*
  181.     ICCStopComponent
  182.     
  183.     PPC glue to call the component with the correct selector.
  184. */
  185. pascal ICError ICCStopComponent(internetConfigurationComponent inst){
  186.     ICError err;
  187.     
  188. #pragma options align=mac68k
  189.     struct ICCallGlue {
  190.         PPC_VoidGlue;
  191.     };
  192.     
  193.     typedef struct ICCallGlue ICCallGlue;
  194. #pragma options align=reset
  195.     
  196.     ICCallGlue glue;
  197.     
  198.     SetupVoidGlue(glue,kICCStop,inst);
  199.     
  200.     err=CallComponentGlue(&glue);
  201.     
  202.     return err;
  203. }
  204.  
  205. /*
  206.     
  207.     PPC glue to call the component with the correct selector.
  208. */
  209. pascal ICError ICCFindConfigFile(internetConfigurationComponent inst, short count, ICDirSpecArrayPtr folders){
  210.     
  211. #pragma options align=mac68k
  212.     /*
  213.         For each of the glue routines, the GlueParms structure is defined.  It contains all of the parameters
  214.         required to call the component while passing the correct parameters.
  215.         
  216.         Note that the elements are listed in the reverse order of the parameters
  217.     */
  218.     struct GlueParms {
  219.         ICDirSpecArrayPtr folders;
  220.         short count;
  221.     };
  222.     
  223.     typedef struct GlueParms GlueParms;
  224.     
  225.     /*
  226.         Then the ICCallGlue structure is defined using the GlueParms structure to ensure the size
  227.         of the structure is set up correctly.
  228.     */
  229.     struct ICCallGlue {
  230.         PPC_Glue(GlueParms);
  231.     };
  232.     
  233.     typedef struct ICCallGlue ICCallGlue;
  234. #pragma options align=reset
  235.     
  236.     // A single variable named 'glue' is defined using the ICCallGlue type
  237.     ICCallGlue glue;
  238.     
  239.     // The glue variable is initialized using the selector, type, and instance of the component.
  240.     SetupGlue(glue,kICCFindConfigFile,GlueParms,inst);
  241.     
  242.     // Any parameters in the GlueParms structure are initialized
  243.     SetGlueParm(glue,folders,folders);
  244.     SetGlueParm(glue,count,count);
  245.     
  246.     // Call the componen UPP using a pointer to the glue variable.
  247.     return CallComponentGlue(&glue);
  248. }
  249.  
  250. /*
  251.     
  252.     PPC glue to call the component with the correct selector.
  253. */
  254. pascal ICError ICCFindUserConfigFile(internetConfigurationComponent inst, ICDirSpec *where){
  255. #pragma options align=mac68k
  256.     struct GlueParms {
  257.         ICDirSpec* where;
  258.     };
  259.     
  260.     typedef struct GlueParms GlueParms;
  261.     
  262.     struct ICCallGlue {
  263.         PPC_Glue(GlueParms);
  264.     };
  265.     
  266.     typedef struct ICCallGlue ICCallGlue;
  267. #pragma options align=reset
  268.     
  269.     ICCallGlue glue;
  270.     
  271.     SetupGlue(glue,kICCFindUserConfigFile,GlueParms,inst);
  272.     
  273.     SetGlueParm(glue,where,where);
  274.     
  275.     return CallComponentGlue(&glue);
  276. }
  277.  
  278. /*
  279.     
  280.     PPC glue to call the component with the correct selector.
  281. */
  282. pascal ICError ICCGeneralFindConfigFile(internetConfigurationComponent inst, Boolean search_prefs, Boolean can_create,
  283.         short count, ICDirSpecArrayPtr folders){
  284. #pragma options align=mac68k
  285.     struct GlueParms {
  286.         ICDirSpecArrayPtr folders;
  287.         short count;
  288.         Boolean can_create;
  289.         char filler1;
  290.         Boolean search_prefs;
  291.         char filler0;
  292.     };
  293.     
  294.     typedef struct GlueParms GlueParms;
  295.     
  296.     struct ICCallGlue {
  297.         PPC_Glue(GlueParms);
  298.     };
  299.     
  300.     typedef struct ICCallGlue ICCallGlue;
  301. #pragma options align=reset
  302.     
  303.     ICCallGlue glue;
  304.     
  305.     SetupGlue(glue,kICCGeneralFindConfigFile,GlueParms,inst);
  306.     
  307.     SetGlueParm(glue,search_prefs,search_prefs);
  308.     SetGlueParm(glue,filler1,0);
  309.     SetGlueParm(glue,filler0,0);
  310.     SetGlueParm(glue,can_create,can_create);
  311.     SetGlueParm(glue,count,count);
  312.     SetGlueParm(glue,folders,folders);
  313.     
  314.     return CallComponentGlue(&glue);
  315. }
  316.  
  317. /*
  318.     ICCChoseConfig
  319.     
  320.     PPC glue to call the component with the correct selector.
  321. */
  322. pascal ICError ICCChooseConfig(internetConfigurationComponent inst){
  323.     ICError err;
  324.     
  325. #pragma options align=mac68k
  326.     struct ICCallGlue {
  327.         PPC_VoidGlue;
  328.     };
  329.     
  330.     typedef struct ICCallGlue ICCallGlue;
  331. #pragma options align=reset
  332.     
  333.     ICCallGlue glue;
  334.     
  335.     SetupVoidGlue(glue,kICCChooseConfig,inst);
  336.     
  337.     err=CallComponentGlue(&glue);
  338.     
  339.     return err;
  340. }
  341.  
  342. /*
  343.     ICCChoseNewConfig
  344.     
  345.     PPC glue to call the component with the correct selector.
  346. */
  347. pascal ICError ICCChooseNewConfig(internetConfigurationComponent inst){
  348.     ICError err;
  349.     
  350. #pragma options align=mac68k
  351.     struct ICCallGlue {
  352.         PPC_VoidGlue;
  353.     };
  354.     
  355.     typedef struct ICCallGlue ICCallGlue;
  356. #pragma options align=reset
  357.     
  358.     ICCallGlue glue;
  359.     
  360.     SetupVoidGlue(glue,kICCChooseNewConfig,inst);
  361.     
  362.     err=CallComponentGlue(&glue);
  363.     
  364.     return err;
  365. }
  366.  
  367. /*
  368.     
  369.     PPC glue to call the component with the correct selector.
  370. */
  371. pascal ICError ICCGetConfigName(internetConfigurationComponent inst, Boolean longname,StringPtr name){
  372. #pragma options align=mac68k
  373.     struct GlueParms {
  374.         StringPtr name;
  375.         Boolean longname;
  376.         char filler;
  377.     };
  378.     
  379.     typedef struct GlueParms GlueParms;
  380.     
  381.     struct ICCallGlue {
  382.         PPC_Glue(GlueParms);
  383.     };
  384.     
  385.     typedef struct ICCallGlue ICCallGlue;
  386. #pragma options align=reset
  387.     
  388.     ICCallGlue glue;
  389.     
  390.     SetupGlue(glue,kICCGetConfigName,GlueParms,inst);
  391.     
  392.     SetGlueParm(glue,name,((StringPtr)name));
  393.     SetGlueParm(glue,longname,longname);
  394.     SetGlueParm(glue,filler,0);
  395.     
  396.     return CallComponentGlue(&glue);
  397. }
  398.  
  399. /*
  400.     
  401.     PPC glue to call the component with the correct selector.
  402. */
  403. pascal ICError ICCGetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref){
  404. #pragma options align=mac68k
  405.     struct GlueParms {
  406.         ICConfigRefHandle ref;
  407.     };
  408.     
  409.     typedef struct GlueParms GlueParms;
  410.     
  411.     struct ICCallGlue {
  412.         PPC_Glue(GlueParms);
  413.     };
  414.     
  415.     typedef struct ICCallGlue ICCallGlue;
  416. #pragma options align=reset
  417.     
  418.     ICCallGlue glue;
  419.     
  420.     SetupGlue(glue,kICCGetConfigReference,GlueParms,inst);
  421.     
  422.     SetGlueParm(glue,ref,ref);
  423.     
  424.     return CallComponentGlue(&glue);
  425. }
  426.  
  427. /*
  428.     
  429.     PPC glue to call the component with the correct selector.
  430. */
  431. pascal ICError ICCSetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref, long flags){
  432. #pragma options align=mac68k
  433.     struct GlueParms {
  434.         long flags;
  435.         ICConfigRefHandle ref;
  436.     };
  437.     
  438.     typedef struct GlueParms GlueParms;
  439.     
  440.     struct ICCallGlue {
  441.         PPC_Glue(GlueParms);
  442.     };
  443.     
  444.     typedef struct ICCallGlue ICCallGlue;
  445. #pragma options align=reset
  446.     
  447.     ICCallGlue glue;
  448.     
  449.     SetupGlue(glue,kICCSetConfigReference,GlueParms,inst);
  450.     
  451.     SetGlueParm(glue,flags,flags);
  452.     SetGlueParm(glue,ref,ref);
  453.     
  454.     return CallComponentGlue(&glue);
  455. }
  456.  
  457. /*
  458.     
  459.     PPC glue to call the component with the correct selector.
  460. */
  461. pascal ICError ICCSpecifyConfigFile(internetConfigurationComponent inst, FSSpec *config){
  462. #pragma options align=mac68k
  463.     struct GlueParms {
  464.         FSSpec* config;
  465.     };
  466.     
  467.     typedef struct GlueParms GlueParms;
  468.     
  469.     struct ICCallGlue {
  470.         PPC_Glue(GlueParms);
  471.     };
  472.     
  473.     typedef struct ICCallGlue ICCallGlue;
  474. #pragma options align=reset
  475.     
  476.     ICCallGlue glue;
  477.     
  478.     SetupGlue(glue,kICCSpecifyConfigFile,GlueParms,inst);
  479.     
  480.     SetGlueParm(glue,config,config);
  481.     
  482.     return CallComponentGlue(&glue);
  483. }
  484.  
  485. /*
  486.     
  487.     PPC glue to call the component with the correct selector.
  488. */
  489. pascal ICError ICCGetSeed(internetConfigurationComponent inst, long *seed){
  490. #pragma options align=mac68k
  491.     struct GlueParms {
  492.         long* seed;
  493.     };
  494.     
  495.     typedef struct GlueParms GlueParms;
  496.     
  497.     struct ICCallGlue {
  498.         PPC_Glue(GlueParms);
  499.     };
  500.     
  501.     typedef struct ICCallGlue ICCallGlue;
  502. #pragma options align=reset
  503.     
  504.     ICCallGlue glue;
  505.     
  506.     SetupGlue(glue,kICCGetSeed,GlueParms,inst);
  507.     
  508.     SetGlueParm(glue,seed,seed);
  509.     
  510.     return CallComponentGlue(&glue);
  511. }
  512.  
  513. /*
  514.     
  515.     PPC glue to call the component with the correct selector.
  516. */
  517. pascal ICError ICCGetPerm(internetConfigurationComponent inst, ICPerm *perm){
  518. #pragma options align=mac68k
  519.     struct GlueParms {
  520.         ICPerm* perm;
  521.     };
  522.     
  523.     typedef struct GlueParms GlueParms;
  524.     
  525.     struct ICCallGlue {
  526.         PPC_Glue(GlueParms);
  527.     };
  528.     
  529.     typedef struct ICCallGlue ICCallGlue;
  530. #pragma options align=reset
  531.     
  532.     ICCallGlue glue;
  533.     
  534.     SetupGlue(glue,kICCGetPerm,GlueParms,inst);
  535.     
  536.     SetGlueParm(glue,perm,perm);
  537.     
  538.     return CallComponentGlue(&glue);
  539.     
  540. }
  541.  
  542. /*
  543.     
  544.     PPC glue to call the component with the correct selector.
  545. */
  546. pascal ICError ICCBegin(internetConfigurationComponent inst, ICPerm perm){
  547. #pragma options align=mac68k
  548.     struct GlueParms {
  549.         ICPerm perm;
  550.         char filler0;
  551.     };
  552.     
  553.     typedef struct GlueParms GlueParms;
  554.     
  555.     struct ICCallGlue {
  556.         PPC_Glue(GlueParms);
  557.     };
  558.     
  559.     typedef struct ICCallGlue ICCallGlue;
  560. #pragma options align=reset
  561.     
  562.     ICCallGlue glue;
  563.     
  564.     SetupGlue(glue,kICCBegin,GlueParms,inst);
  565.     
  566.     SetGlueParm(glue,perm,perm);
  567.     SetGlueParm(glue,filler0,0);
  568.     
  569.     return CallComponentGlue(&glue);
  570. }
  571.  
  572. /*
  573.     
  574.     PPC glue to call the component with the correct selector.
  575. */
  576. pascal ICError ICCGetPref(internetConfigurationComponent inst,StringPtr key, ICAttr *attr, Ptr buf, long *size){
  577. #pragma options align=mac68k
  578.     struct GlueParms {
  579.         long* size;
  580.         Ptr buf;
  581.         ICAttr* attr;
  582.         StringPtr key;
  583.     };
  584.     
  585.     typedef struct GlueParms GlueParms;
  586.     
  587.     struct ICCallGlue {
  588.         PPC_Glue(GlueParms);
  589.     };
  590.     
  591.     typedef struct ICCallGlue ICCallGlue;
  592. #pragma options align=reset
  593.     
  594.     ICCallGlue glue;
  595.     
  596.     SetupGlue(glue,kICCGetPref,GlueParms,inst);
  597.     
  598.     SetGlueParm(glue,size,size);
  599.     SetGlueParm(glue,buf,buf);
  600.     SetGlueParm(glue,attr,attr);
  601.     SetGlueParm(glue,key,key);
  602.     
  603.     return CallComponentGlue(&glue);
  604. }
  605.  
  606. /*
  607.     
  608.     PPC glue to call the component with the correct selector.
  609. */
  610. pascal ICError ICCSetPref(internetConfigurationComponent inst,StringPtr key, ICAttr attr, Ptr buf, long size){
  611. #pragma options align=mac68k
  612.     struct GlueParms {
  613.         long size;
  614.         Ptr buf;
  615.         ICAttr attr;
  616.         StringPtr key;
  617.     };
  618.     
  619.     typedef struct GlueParms GlueParms;
  620.     
  621.     struct ICCallGlue {
  622.         PPC_Glue(GlueParms);
  623.     };
  624.     
  625.     typedef struct ICCallGlue ICCallGlue;
  626. #pragma options align=reset
  627.     
  628.     ICCallGlue glue;
  629.     
  630.     SetupGlue(glue,kICCSetPref,GlueParms,inst);
  631.     
  632.     SetGlueParm(glue,size,size);
  633.     SetGlueParm(glue,buf,buf);
  634.     SetGlueParm(glue,attr,attr);
  635.     SetGlueParm(glue,key,key);
  636.     
  637.     return CallComponentGlue(&glue);
  638. }
  639.  
  640. /*
  641.     
  642.     PPC glue to call the component with the correct selector.
  643. */
  644. pascal ICError ICCFindPrefHandle(internetConfigurationComponent inst,StringPtr key, ICAttr *attr, Handle prefh){
  645. #pragma options align=mac68k
  646.     struct GlueParms {
  647.         Handle prefh;
  648.         ICAttr* attr;
  649.         StringPtr key;
  650.     };
  651.     
  652.     typedef struct GlueParms GlueParms;
  653.     
  654.     struct ICCallGlue {
  655.         PPC_Glue(GlueParms);
  656.     };
  657.     
  658.     typedef struct ICCallGlue ICCallGlue;
  659. #pragma options align=reset
  660.     
  661.     ICCallGlue glue;
  662.     
  663.     SetupGlue(glue,kICCFindPrefHandle,GlueParms,inst);
  664.     
  665.     SetGlueParm(glue,attr,attr);
  666.     SetGlueParm(glue,prefh,prefh);
  667.     SetGlueParm(glue,key,key);
  668.     
  669.     return CallComponentGlue(&glue);
  670. }
  671.  
  672. /*
  673.     
  674.     PPC glue to call the component with the correct selector.
  675. */
  676. pascal ICError ICCGetPrefHandle(internetConfigurationComponent inst,StringPtr key, ICAttr *attr, Handle *prefh){
  677. #pragma options align=mac68k
  678.     struct GlueParms {
  679.         Handle* prefh;
  680.         ICAttr* attr;
  681.         StringPtr key;
  682.     };
  683.     
  684.     typedef struct GlueParms GlueParms;
  685.     
  686.     struct ICCallGlue {
  687.         PPC_Glue(GlueParms);
  688.     };
  689.     
  690.     typedef struct ICCallGlue ICCallGlue;
  691. #pragma options align=reset
  692.     
  693.     ICCallGlue glue;
  694.     
  695.     SetupGlue(glue,kICCGetPrefHandle,GlueParms,inst);
  696.     
  697.     SetGlueParm(glue,attr,attr);
  698.     SetGlueParm(glue,prefh,prefh);
  699.     SetGlueParm(glue,key,key);
  700.     
  701.     return CallComponentGlue(&glue);
  702. }
  703.  
  704. /*
  705.     
  706.     PPC glue to call the component with the correct selector.
  707. */
  708. pascal ICError ICCSetPrefHandle(internetConfigurationComponent inst,StringPtr key, ICAttr attr, Handle prefh){
  709. #pragma options align=mac68k
  710.     struct GlueParms {
  711.         Handle prefh;
  712.         ICAttr attr;
  713.         StringPtr key;
  714.     };
  715.     
  716.     typedef struct GlueParms GlueParms;
  717.     
  718.     struct ICCallGlue {
  719.         PPC_Glue(GlueParms);
  720.     };
  721.     
  722.     typedef struct ICCallGlue ICCallGlue;
  723. #pragma options align=reset
  724.     
  725.     ICCallGlue glue;
  726.     
  727.     SetupGlue(glue,kICCSetPrefHandle,GlueParms,inst);
  728.     
  729.     SetGlueParm(glue,attr,attr);
  730.     SetGlueParm(glue,prefh,prefh);
  731.     SetGlueParm(glue,key,key);
  732.     
  733.     return CallComponentGlue(&glue);
  734. }
  735.  
  736. /*
  737.     
  738.     PPC glue to call the component with the correct selector.
  739. */
  740. pascal ICError ICCCountPref(internetConfigurationComponent inst, long *count){
  741. #pragma options align=mac68k
  742.     struct GlueParms {
  743.         long* count;
  744.     };
  745.     
  746.     typedef struct GlueParms GlueParms;
  747.     
  748.     struct ICCallGlue {
  749.         PPC_Glue(GlueParms);
  750.     };
  751.     
  752.     typedef struct ICCallGlue ICCallGlue;
  753. #pragma options align=reset
  754.     
  755.     ICCallGlue glue;
  756.     
  757.     SetupGlue(glue,kICCCountPref,GlueParms,inst);
  758.     
  759.     SetGlueParm(glue,count,count);
  760.     
  761.     return CallComponentGlue(&glue);
  762. }
  763.  
  764. /*
  765.     
  766.     PPC glue to call the component with the correct selector.
  767. */
  768. pascal ICError ICCGetIndPref(internetConfigurationComponent inst, long n,StringPtr key){
  769. #pragma options align=mac68k
  770.     struct GlueParms {
  771.         StringPtr key;
  772.         long n;
  773.     };
  774.     
  775.     typedef struct GlueParms GlueParms;
  776.     
  777.     struct ICCallGlue {
  778.         PPC_Glue(GlueParms);
  779.     };
  780.     
  781.     typedef struct ICCallGlue ICCallGlue;
  782. #pragma options align=reset
  783.     
  784.     ICCallGlue glue;
  785.     
  786.     SetupGlue(glue,kICCGetIndPref,GlueParms,inst);
  787.     
  788.     SetGlueParm(glue,key,key);
  789.     SetGlueParm(glue,n,n);
  790.     
  791.     return CallComponentGlue(&glue);
  792. }
  793.  
  794. /*
  795.     
  796.     PPC glue to call the component with the correct selector.
  797. */
  798. pascal ICError ICCDeletePref(internetConfigurationComponent inst,StringPtr key){
  799. #pragma options align=mac68k
  800.     struct GlueParms {
  801.         StringPtr key;
  802.     };
  803.     
  804.     typedef struct GlueParms GlueParms;
  805.     
  806.     struct ICCallGlue {
  807.         PPC_Glue(GlueParms);
  808.     };
  809.     
  810.     typedef struct ICCallGlue ICCallGlue;
  811. #pragma options align=reset
  812.     
  813.     ICCallGlue glue;
  814.     
  815.     SetupGlue(glue,kICCDeletePref,GlueParms,inst);
  816.     
  817.     SetGlueParm(glue,key,key);
  818.     
  819.     return CallComponentGlue(&glue);
  820. }
  821.  
  822. /*
  823.     
  824.     PPC glue to call the component with the correct selector.
  825. */
  826. pascal ICError ICCEnd(internetConfigurationComponent inst){
  827. #pragma options align=mac68k
  828.     struct ICCallGlue {
  829.         PPC_VoidGlue;
  830.     };
  831.     
  832.     typedef struct ICCallGlue ICCallGlue;
  833. #pragma options align=reset
  834.     
  835.     ICCallGlue glue;
  836.     
  837.     SetupVoidGlue(glue,kICCEnd,inst);
  838.     
  839.     return CallComponentGlue(&glue);
  840. }
  841.  
  842. /*
  843.     
  844.     PPC glue to call the component with the correct selector.
  845. */
  846. pascal ICError ICCDefaultFileName(internetConfigurationComponent inst,StringPtr name){
  847. #pragma options align=mac68k
  848.     struct GlueParms {
  849.         StringPtr name;
  850.     };
  851.     
  852.     typedef struct GlueParms GlueParms;
  853.     
  854.     struct ICCallGlue {
  855.         PPC_Glue(GlueParms);
  856.     };
  857.     
  858.     typedef struct ICCallGlue ICCallGlue;
  859. #pragma options align=reset
  860.     
  861.     ICCallGlue glue;
  862.     
  863.     SetupGlue(glue,kICCDefaultFileName,GlueParms,inst);
  864.     
  865.     SetGlueParm(glue,name,name);
  866.     
  867.     return CallComponentGlue(&glue);
  868. }
  869.  
  870. /*
  871.     
  872.     PPC glue to call the component with the correct selector.
  873. */
  874. pascal ICError ICCGetComponentInstance(internetConfigurationComponent inst, Ptr *component_inst){
  875.     *component_inst = (Ptr)inst;
  876.     return (ICError)noErr;
  877. }
  878.  
  879. /*
  880.     
  881.     PPC glue to call the component with the correct selector.
  882. */
  883. pascal ICError ICCEditPreferences(internetConfigurationComponent inst,StringPtr key){
  884. #pragma options align=mac68k
  885.     struct GlueParms {
  886.         StringPtr key;
  887.     };
  888.     
  889.     typedef struct GlueParms GlueParms;
  890.     
  891.     struct ICCallGlue {
  892.         PPC_Glue(GlueParms);
  893.     };
  894.     
  895.     typedef struct ICCallGlue ICCallGlue;
  896. #pragma options align=reset
  897.     
  898.     ICCallGlue glue;
  899.     
  900.     SetupGlue(glue,kICCEditPreferences,GlueParms,inst);
  901.     
  902.     SetGlueParm(glue,key,key);
  903.     
  904.     return CallComponentGlue(&glue);
  905. }
  906.  
  907. /*
  908.     
  909.     PPC glue to call the component with the correct selector.
  910. */
  911. pascal ICError ICCParseURL(internetConfigurationComponent inst,StringPtr hint, Ptr data, long len,
  912.         long *selStart, long *selEnd, Handle url){
  913. #pragma options align=mac68k
  914.     struct GlueParms {
  915.         Handle url;
  916.         long* selEnd;
  917.         long* selStart;
  918.         long len;
  919.         Ptr data;
  920.         StringPtr hint;
  921.     };
  922.     
  923.     typedef struct GlueParms GlueParms;
  924.     
  925.     struct ICCallGlue {
  926.         PPC_Glue(GlueParms);
  927.     };
  928.     
  929.     typedef struct ICCallGlue ICCallGlue;
  930. #pragma options align=reset
  931.     
  932.     ICCallGlue glue;
  933.     
  934.     SetupGlue(glue,kICCParseURL,GlueParms,inst);
  935.     
  936.     SetGlueParm(glue,url,url);
  937.     SetGlueParm(glue,selEnd,selEnd);
  938.     SetGlueParm(glue,selStart,selStart);
  939.     SetGlueParm(glue,len,len);
  940.     SetGlueParm(glue,hint,hint);
  941.     SetGlueParm(glue,data,data);
  942.     
  943.     return CallComponentGlue(&glue);
  944. }
  945.  
  946. /*
  947.     
  948.     PPC glue to call the component with the correct selector.
  949. */
  950. pascal ICError ICCLaunchURL(internetConfigurationComponent inst,StringPtr hint, Ptr data, long len,
  951.     long *selStart, long *selEnd){
  952. #pragma options align=mac68k
  953.     struct GlueParms {
  954.         long* selEnd;
  955.         long* selStart;
  956.         long len;
  957.         Ptr data;
  958.         StringPtr hint;
  959.     };
  960.     
  961.     typedef struct GlueParms GlueParms;
  962.     
  963.     struct ICCallGlue {
  964.         PPC_Glue(GlueParms);
  965.     };
  966.     
  967.     typedef struct ICCallGlue ICCallGlue;
  968. #pragma options align=reset
  969.     
  970.     ICCallGlue glue;
  971.     
  972.     SetupGlue(glue,kICCLaunchURL,GlueParms,inst);
  973.     
  974.     SetGlueParm(glue,selEnd,selEnd);
  975.     SetGlueParm(glue,selStart,selStart);
  976.     SetGlueParm(glue,len,len);
  977.     SetGlueParm(glue,hint,hint);
  978.     SetGlueParm(glue,data,data);
  979.     
  980.     return CallComponentGlue(&glue);
  981. }
  982.  
  983. /*
  984.     
  985.     PPC glue to call the component with the correct selector.
  986. */
  987. pascal ICError ICCMapFilename(internetConfigurationComponent inst,StringPtr filename, ICMapEntry *entry){
  988. #pragma options align=mac68k
  989.     struct GlueParms {
  990.         ICMapEntry* entry;
  991.         StringPtr filename;
  992.     };
  993.     
  994.     typedef struct GlueParms GlueParms;
  995.     
  996.     struct ICCallGlue {
  997.         PPC_Glue(GlueParms);
  998.     };
  999.     
  1000.     typedef struct ICCallGlue ICCallGlue;
  1001. #pragma options align=reset
  1002.     
  1003.     ICCallGlue glue;
  1004.     
  1005.     SetupGlue(glue,kICCMapFilename,GlueParms,inst);
  1006.     
  1007.     SetGlueParm(glue,entry,entry);
  1008.     SetGlueParm(glue,filename,filename);
  1009.     
  1010.     return CallComponentGlue(&glue);
  1011. }
  1012.  
  1013. /*
  1014.     
  1015.     PPC glue to call the component with the correct selector.
  1016. */
  1017. pascal ICError ICCMapTypeCreator(internetConfigurationComponent inst, OSType fType, OSType fCreator,StringPtr filename,
  1018.     ICMapEntry *entry){
  1019. #pragma options align=mac68k
  1020.     struct GlueParms {
  1021.         ICMapEntry* entry;
  1022.         StringPtr filename;
  1023.         OSType fCreator;
  1024.         OSType fType;
  1025.     };
  1026.     
  1027.     typedef struct GlueParms GlueParms;
  1028.     
  1029.     struct ICCallGlue {
  1030.         PPC_Glue(GlueParms);
  1031.     };
  1032.     
  1033.     typedef struct ICCallGlue ICCallGlue;
  1034. #pragma options align=reset
  1035.     
  1036.     ICCallGlue glue;
  1037.     
  1038.     SetupGlue(glue,kICCMapTypeCreator,GlueParms,inst);
  1039.     
  1040.     SetGlueParm(glue,entry,entry);
  1041.     SetGlueParm(glue,fCreator,fCreator);
  1042.     SetGlueParm(glue,fType,fType);
  1043.     SetGlueParm(glue,filename,filename);
  1044.     
  1045.     return CallComponentGlue(&glue);
  1046. }
  1047.  
  1048. /*
  1049.     
  1050.     PPC glue to call the component with the correct selector.
  1051. */
  1052. pascal ICError ICCMapEntriesFilename(internetConfigurationComponent inst, Handle entries,StringPtr filename, ICMapEntry *entry){
  1053. #pragma options align=mac68k
  1054.     struct GlueParms {
  1055.         ICMapEntry* entry;
  1056.         StringPtr filename;
  1057.         Handle entries;
  1058.     };
  1059.     
  1060.     typedef struct GlueParms GlueParms;
  1061.     
  1062.     struct ICCallGlue {
  1063.         PPC_Glue(GlueParms);
  1064.     };
  1065.     
  1066.     typedef struct ICCallGlue ICCallGlue;
  1067. #pragma options align=reset
  1068.     
  1069.     ICCallGlue glue;
  1070.     
  1071.     SetupGlue(glue,kICCMapEntriesFilename,GlueParms,inst);
  1072.     
  1073.     SetGlueParm(glue,entry,entry);
  1074.     SetGlueParm(glue,entries,entries);
  1075.     SetGlueParm(glue,filename,filename);
  1076.     
  1077.     return CallComponentGlue(&glue);
  1078. }
  1079.  
  1080. /*
  1081.     
  1082.     PPC glue to call the component with the correct selector.
  1083. */
  1084. pascal ICError ICCMapEntriesTypeCreator(internetConfigurationComponent inst, Handle entries, OSType fType, OSType fCreator,
  1085.         StringPtr filename, ICMapEntry *entry){
  1086. #pragma options align=mac68k
  1087.     struct GlueParms {
  1088.         ICMapEntry* entry;
  1089.         StringPtr filename;
  1090.         OSType fCreator;
  1091.         OSType fType;
  1092.         Handle entries;
  1093.     };
  1094.     
  1095.     typedef struct GlueParms GlueParms;
  1096.     
  1097.     struct ICCallGlue {
  1098.         PPC_Glue(GlueParms);
  1099.     };
  1100.     
  1101.     typedef struct ICCallGlue ICCallGlue;
  1102. #pragma options align=reset
  1103.     
  1104.     ICCallGlue glue;
  1105.     
  1106.     SetupGlue(glue,kICCMapEntriesTypeCreator,GlueParms,inst);
  1107.     
  1108.     SetGlueParm(glue,entry,entry);
  1109.     SetGlueParm(glue,fCreator,fCreator);
  1110.     SetGlueParm(glue,entries,entries);
  1111.     SetGlueParm(glue,fType,fType);
  1112.     SetGlueParm(glue,filename,filename);
  1113.     
  1114.     return CallComponentGlue(&glue);
  1115. }
  1116.  
  1117. /*
  1118.     
  1119.     PPC glue to call the component with the correct selector.
  1120. */
  1121. pascal ICError ICCCountMapEntries(internetConfigurationComponent inst, Handle entries, long *count){
  1122. #pragma options align=mac68k
  1123.     struct GlueParms {
  1124.         long* count;
  1125.         Handle entries;
  1126.     };
  1127.     
  1128.     typedef struct GlueParms GlueParms;
  1129.     
  1130.     struct ICCallGlue {
  1131.         PPC_Glue(GlueParms);
  1132.     };
  1133.     
  1134.     typedef struct ICCallGlue ICCallGlue;
  1135. #pragma options align=reset
  1136.     
  1137.     ICCallGlue glue;
  1138.     
  1139.     SetupGlue(glue,kICCCountMapEntries,GlueParms,inst);
  1140.     
  1141.     SetGlueParm(glue,count,count);
  1142.     SetGlueParm(glue,entries,entries);
  1143.     
  1144.     return CallComponentGlue(&glue);
  1145. }
  1146.  
  1147. /*
  1148.     
  1149.     PPC glue to call the component with the correct selector.
  1150. */
  1151. pascal ICError ICCGetIndMapEntry(internetConfigurationComponent inst, Handle entries, long ndx, long *pos, ICMapEntry *entry){
  1152. #pragma options align=mac68k
  1153.     struct GlueParms {
  1154.         ICMapEntry* entry;
  1155.         long* pos;
  1156.         long ndx;
  1157.         Handle entries;
  1158.     };
  1159.     
  1160.     typedef struct GlueParms GlueParms;
  1161.     
  1162.     struct ICCallGlue {
  1163.         PPC_Glue(GlueParms);
  1164.     };
  1165.     
  1166.     typedef struct ICCallGlue ICCallGlue;
  1167. #pragma options align=reset
  1168.     
  1169.     ICCallGlue glue;
  1170.     
  1171.     SetupGlue(glue,kICCGetIndMapEntry,GlueParms,inst);
  1172.     
  1173.     SetGlueParm(glue,entry,entry);
  1174.     SetGlueParm(glue,pos,pos);
  1175.     SetGlueParm(glue,ndx,ndx);
  1176.     SetGlueParm(glue,entries,entries);
  1177.     
  1178.     return CallComponentGlue(&glue);
  1179. }
  1180.  
  1181. /*
  1182.     
  1183.     PPC glue to call the component with the correct selector.
  1184. */
  1185. pascal ICError ICCGetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry){
  1186. #pragma options align=mac68k
  1187.     struct GlueParms {
  1188.         ICMapEntry* entry;
  1189.         long pos;
  1190.         Handle entries;
  1191.     };
  1192.     
  1193.     typedef struct GlueParms GlueParms;
  1194.     
  1195.     struct ICCallGlue {
  1196.         PPC_Glue(GlueParms);
  1197.     };
  1198.     
  1199.     typedef struct ICCallGlue ICCallGlue;
  1200. #pragma options align=reset
  1201.     
  1202.     ICCallGlue glue;
  1203.     
  1204.     SetupGlue(glue,kICCGetMapEntry,GlueParms,inst);
  1205.     
  1206.     SetGlueParm(glue,entry,entry);
  1207.     SetGlueParm(glue,pos,pos);
  1208.     SetGlueParm(glue,entries,entries);
  1209.     
  1210.     return CallComponentGlue(&glue);
  1211.     
  1212. }
  1213.  
  1214. /*
  1215.     
  1216.     PPC glue to call the component with the correct selector.
  1217. */
  1218. pascal ICError ICCSetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry){
  1219. #pragma options align=mac68k
  1220.     struct GlueParms {
  1221.         ICMapEntry* entry;
  1222.         long pos;
  1223.         Handle entries;
  1224.     };
  1225.     
  1226.     typedef struct GlueParms GlueParms;
  1227.     
  1228.     struct ICCallGlue {
  1229.         PPC_Glue(GlueParms);
  1230.     };
  1231.     
  1232.     typedef struct ICCallGlue ICCallGlue;
  1233. #pragma options align=reset
  1234.     
  1235.     ICCallGlue glue;
  1236.     
  1237.     SetupGlue(glue,kICCSetMapEntry,GlueParms,inst);
  1238.     
  1239.     SetGlueParm(glue,entry,entry);
  1240.     SetGlueParm(glue,pos,pos);
  1241.     SetGlueParm(glue,entries,entries);
  1242.     
  1243.     return CallComponentGlue(&glue);
  1244. }
  1245.  
  1246. /*
  1247.     
  1248.     PPC glue to call the component with the correct selector.
  1249. */
  1250. pascal ICError ICCDeleteMapEntry(internetConfigurationComponent inst, Handle entries, long pos){
  1251. #pragma options align=mac68k
  1252.     struct GlueParms {
  1253.         long pos;
  1254.         Handle entries;
  1255.     };
  1256.     
  1257.     typedef struct GlueParms GlueParms;
  1258.     
  1259.     struct ICCallGlue {
  1260.         PPC_Glue(GlueParms);
  1261.     };
  1262.     
  1263.     typedef struct ICCallGlue ICCallGlue;
  1264. #pragma options align=reset
  1265.     
  1266.     ICCallGlue glue;
  1267.     
  1268.     SetupGlue(glue,kICCDeleteMapEntry,GlueParms,inst);
  1269.     
  1270.     SetGlueParm(glue,pos,pos);
  1271.     SetGlueParm(glue,entries,entries);
  1272.     
  1273.     return CallComponentGlue(&glue);
  1274. }
  1275.  
  1276. /*
  1277.     
  1278.     PPC glue to call the component with the correct selector.
  1279. */
  1280. pascal ICError ICCAddMapEntry(internetConfigurationComponent inst, Handle entries, ICMapEntry *entry){
  1281. #pragma options align=mac68k
  1282.     struct GlueParms {
  1283.         ICMapEntry* entry;
  1284.         Handle entries;
  1285.     };
  1286.     
  1287.     typedef struct GlueParms GlueParms;
  1288.     
  1289.     struct ICCallGlue {
  1290.         PPC_Glue(GlueParms);
  1291.     };
  1292.     
  1293.     typedef struct ICCallGlue ICCallGlue;
  1294. #pragma options align=reset
  1295.     
  1296.     ICCallGlue glue;
  1297.     
  1298.     SetupGlue(glue,kICCAddMapEntry,GlueParms,inst);
  1299.     
  1300.     SetGlueParm(glue,entry,entry);
  1301.     SetGlueParm(glue,entries,entries);
  1302.     
  1303.     return CallComponentGlue(&glue);
  1304. }
  1305.  
  1306. #endif /* USESROUTINEDESCRIPTORS */
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.